﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master"
    AutoEventWireup="true" CodeBehind="Register.aspx.cs" Inherits="WuxiWTO.Web.Register" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <script type="text/javascript">

        function checkuser() {
            var name = document.getElementById("<%=txtLoginNameP.ClientID %>").value;
            if (name == "") {
                $("#displayMsg").css("display", "");
                $("#displayMsg").html("*");
                return false;
            }
            else {
                $.ajax({ type: "POST", async: true, url: "checkLogin.ashx", data: { uname: name },
                    success: function (msg) {
                        $("#displayMsg").css("display", "");
                        if (msg == "Y") {
                            $("#displayMsg").html("该用户名已经被注册！"); return false;
                        }
                        else if (msg == "N") {
                            $("#displayMsg").html("该用户名可以注册"); return true;
                        }
                        else {
                            $("#displayMsg").html("错误"); return false;
                        }
                    },
                    error: function (jqXHR, textStatus, errorThrown) {
                        $("#displayMsg").html("错误"); return false;
                    }
                });
            }
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h1 class="main_con_title">
        注册新用户</h1>
    <div id="login">
        <div class="register_sel">
            <ul>
                <li class="choose" id="personal"><a href="Register.aspx">个人会员注册</a></li>
                <li id="company"><a href="RegisterORG.aspx">企业会员注册</a></li>
            </ul>
        </div>
        <table id="perReg" class="login_tb" cellspacing="0" cellpadding="0" width="500">
            <tr>
                <td align="right" style="width:70px;">
                    <label>
                        用户名：</label>
                </td>
                <td>
                    <asp:TextBox runat="server" CssClass="txt3" ID="txtLoginNameP" MaxLength="10"  /> <input type="button" value="检测用户名是否可用" onclick="checkuser()" />
                     <asp:RequiredFieldValidator ID="RequiredFieldValidator2" CssClass="red" ControlToValidate="txtLoginNameP"
                        runat="server" ErrorMessage="*"></asp:RequiredFieldValidator><br />
                    <span id="displayMsg" class="red" style="display:none;"></span>
                </td>
            </tr>
            <tr>
                <td align="right">
                    <label>
                        密码：</label>
                </td>
                <td>
                    <asp:TextBox runat="server" CssClass="txt3" ID="txtPasswordP"  TextMode="Password" MaxLength="20"  />
                    <asp:RequiredFieldValidator ID="rfv2" CssClass="red" ControlToValidate="txtPasswordP"
                        runat="server" ErrorMessage="*"></asp:RequiredFieldValidator>
                </td>
            </tr>
             <tr>
                <td align="right">
                    <label>
                        确认密码：</label>
                </td>
                <td>
                    <asp:TextBox runat="server" CssClass="txt3" ID="txtPassword2"  TextMode="Password"  />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" CssClass="red" ControlToValidate="txtPassword2"
                        runat="server" ErrorMessage="*"></asp:RequiredFieldValidator>
                        <br />
                   <asp:CompareValidator ID="cv1" ControlToCompare="txtPasswordP"  CssClass="red" Display="Dynamic" ControlToValidate="txtPassword2" runat="server" ErrorMessage="两次密码不一致"></asp:CompareValidator>
                </td>
            </tr>
            <tr>
                <td align="right">
                    <label>
                        邮箱：</label>
                </td>
                <td>
                    <asp:TextBox runat="server" CssClass="txt3" ID="txtEmailP" MaxLength="30"/>
                    <asp:RequiredFieldValidator ID="rfv3" CssClass="red" ControlToValidate="txtEmailP"
                        runat="server" ErrorMessage="*"></asp:RequiredFieldValidator><br />
                    <asp:RegularExpressionValidator ID="revEmail" runat="server" Display="Dynamic" ControlToValidate="txtEmailP"
                        ErrorMessage="邮件格式不正确" CssClass="red" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr>
                <td align="right">
                    <label>
                        姓名：</label>
                </td>
                <td>
                    <asp:TextBox runat="server" CssClass="txt3" ID="txtNameP" />
                     <asp:RequiredFieldValidator ID="RequiredFieldValidator3" CssClass="red" ControlToValidate="txtNameP"
                        runat="server" ErrorMessage="*"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td align="right">
                    <label>
                        联系方式：</label>
                </td>
                <td>
                    <asp:TextBox runat="server" CssClass="txt3" ID="txtTelephoneP" MaxLength="15" />
                </td>
            </tr>
            <tr>
                <td align="right">
                    <label>
                        注册目的：</label>
                </td>
                <td>
                    <select class="select1" runat="server" id="ddlPurposeP">
                        <option value="" selected="selected">请选择</option>
                        <option value="2">外商投诉</option>
                        <option value="3">培训报名</option>
                        <option value="4">其他原因</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td align="right">
                    <label>
                        身份证号：</label>
                </td>
                <td>
                    <asp:TextBox runat="server" CssClass="txt3" ID="txtIdentityP" />
                    <asp:RequiredFieldValidator ID="rfvIDP" CssClass="red" ControlToValidate="txtIdentityP"
                        runat="server" ErrorMessage="*"></asp:RequiredFieldValidator><br />
                    <asp:RegularExpressionValidator ID="revIDP" runat="server" Display="Dynamic" ControlToValidate="txtIdentityP"
                        ErrorMessage="身份证号不正确" CssClass="red" ValidationExpression="\d{17}[\d|X]|\d{15}"></asp:RegularExpressionValidator>
                </td>
            </tr>
        </table>
        
        <table class="login_tb" cellspacing="0" cellpadding="0" width="400">
            <tr valign="middle">
                <td>
                </td>
                <td>
                    请阅读，<a href="#">《WTO服务条款》</a>
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;
                </td>
                <td>
                    <asp:Button ID="btnOK" Text="同意以上条款并注册" class="button2" runat="server" 
                        onclick="btnOK_Click" />
                </td>
            </tr>
        </table>
    </div>
    <input type="hidden" id="hidType" runat="server" value="" />
</asp:Content>
